<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title data-i18n="resources.title_tiledMapLayer4326"></title>
    <script type="text/javascript" src="../js/include-web.js"></script>
  </head>
  <body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
    <div id="map" style="margin: 0 auto; width: 100%; height: 100%"></div>
    <script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
    <script type="text/javascript">
      var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
      var map,
        url = host + '/iserver/services/map-world/rest/maps/World';

      // 方式一：1.调用 L.supermap.initMap，根据 SuperMap iServer 地图服务的地图信息，创建地图和底图
      L.supermap.initMap(url);
      /*
        // 方式二：1.调用 L.supermap.MapService，获取 SuperMap iServer 地图服务的地图信息
        //         2.调用 L.supermap.crsFromMapJSON 创建 CRS
        //         3.调用 L.map 创建地图
        //         4.调用 L.supermap.TiledMapLayer 创建底图
        new L.supermap.MapService(url).getMapInfo().then((res) => {
            var crs = L.supermap.crsFromMapJSON(res.result);
            map = L.map('map', {
              crs: crs,
              center: [23.909946174843483, 17.607615853850504],
              maxZoom: 18,
              zoom: 0
            });
            new L.supermap.TiledMapLayer(url).addTo(map);
        });
      */
    </script>
  </body>
</html>
